<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" errorPage="" %>
<%@ page import="com.auth.domain.T_function" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.*" %>
<%@ page import="com.auth.domain.T_function" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%!
    public boolean checkRight(HttpServletRequest request, String funcname) {
        T_function f = null;
        boolean hasRight = false;
        List functList = (List) request.getSession().getAttribute("FREE_USER_AUTH");
        if (functList != null) {
            Iterator it = functList.iterator();
            while (it.hasNext()) {
                f = (T_function) it.next();
                if (f.getFunctname().equals(funcname)) {
                    hasRight = true;
                    return hasRight;
                }
            }
        }
        return false;
    }
%>
<!DOCTYPE HTML>
<html lang="UTF-8">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta http-equiv="Cache-Control" content="no-store"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>
    <link rel="stylesheet" href="<%= basePath %>bootstrap/css/bootstrap.min.css"/>
    <script type="text/javascript" src="<%= basePath %>easyui/jquery.min.js"></script>
    <script type="text/javascript" src="<%= basePath %>bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="<%= basePath %>css/common/box.css"/>
    <link rel="stylesheet" type="text/css" href="<%= basePath %>css/common/checkbox.css"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="<%= basePath %>js/common/tocolor.js"></script>
    <link rel="stylesheet" href="<%= basePath %>css/controlpanel.css"/>
    <link rel="stylesheet" href="<%= basePath %>css/common/skintheme.css"/>
    <!-- <link rel="stylesheet" type="text/css" href="<%= basePath %>easyui/themes/default/easyui.css"> -->
    <link rel="stylesheet" type="text/css" href="<%= basePath %>easyui/themes/icon.css">
    <script src="<%=basePath%>js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="<%= basePath %>js/jquery.cookie.js" type="text/javascript"></script>
    <style>
        .thiscolor {
            display: inline-block;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            margin-right: 10px;
        }

        .thiscolor:HOVER {
            cursor: pointer;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            var themeSkin = 'blue';
            if (themeSkin == "blue") {
                toblue();
            } else if (themeSkin == "green") {
                togreen();
            } else if (themeSkin == "yellow") {
                toyellow();
            } else if (themeSkin == "red") {
                tored();
            }
        });
    </script>
    <script type="text/javascript">
        function funblue() {
            console.log("点击变蓝了");
            //parent.toblue();
            toblue();
        }

        function fungreen() {
            console.log("点击变绿了");
            //parent.togreen();
            togreen();
        }

        function funyellow() {
            console.log("点击变黄了");
            //parent.toyellow();
            toyellow();
        }

        function funred() {
            console.log("点击变红了");
            //parent.tored();
            tored();
        }
    </script>
    <div class="head-show" style="position: relative; height: 76px;">
        <h3 style="display: inline-block; float: left;margin-left: 16px;">控制面板
            <div style="display: inline-block;margin-left: 20px;">
                <span class="thiscolor toblue" style="background-color:#00c0ef" onclick="funblue();"></span>
                <span class="thiscolor togreen" style="background-color:#00a65a" onclick="fungreen();"></span>
                <span class="thiscolor toyellow" style="background-color:#f39c12" onclick="funyellow();"></span>
                <span class="thiscolor tored" style="background-color:#dd4b39" onclick="funred();"></span>
            </div>
        </h3>
        <ol class="breadcrumb pull-right"
            style="float: right; margin-top: 20px; background: transparent;">
            <li><a href="#"> <span class="glyphicon glyphicon-home"></span>
                首页
            </a></li>
            <li class="active">控制面板</li>
        </ol>
    </div>
    <!--第1行 四个面板-->

    <div class="container-fluid">
        <!--文件管理-->
        <% //if(checkRight(request, "监控分析")){ %>
        <div class="col-md-3">
            <div class="jichu kaoqin">
                <div class="wenzi">
                    <a href="<%= basePath %>t_news/toT_newsListAll?1=1"
                       style="text-decoration:none; color: aliceblue">
                        <h2>申请流程</h2>
                        <p>申请流程</p>
                    </a>
                </div>
                <div class="iconfont">
                    <span class="glyphicon glyphicon-folder-open" style="margin-left: 130px;"></span>
                </div>
                <a href="<%= basePath %>t_news/toT_newsListAll?1=1" class="moreduo"> 更多 <span
                        class="glyphicon glyphicon-circle-arrow-right"></span>
                </a>
            </div>
        </div>
        <%//}%>
        <!--文件管理-->
        <div class="col-md-3">
            <div class="jichu filecolor">
                <div class="wenzi">
                    <a href="<%= basePath %>t_news/toT_newsCurdMeeting?oplx=add"
                       style="text-decoration:none; color: aliceblue">
                        <h2>会议室预定</h2>
                        <p>会议室预定</p>
                    </a>
                </div>
                <div class="iconfont">
                    <span class="glyphicon glyphicon-folder-open" style="margin-left: 130px;"></span>
                </div>
                <a href="<%= basePath %>t_news/toT_newsListMeeting?1=1" class="moreduo"> 更多 <span
                        class="glyphicon glyphicon-circle-arrow-right"></span>
                </a>
            </div>
        </div>
        <!--通讯录-->
        <div class="col-md-3">
            <div class="jichu tongxun">
                <div class="wenzi">
                    <a href="<%= basePath %>showUserDetail?1=1" style="text-decoration:none; color: aliceblue">
                        <h2>个人信息</h2>
                        <p>信息查看</p>
                    </a>
                </div>
                <div class="iconfont">
                    <span class="glyphicon glyphicon-earphone"></span>
                </div>
                <a href="<%= basePath %>showUserDetail?1=1" class="moreduo"> 更多 <span
                        class="glyphicon glyphicon-circle-arrow-right"></span>
                </a>
            </div>
        </div>
        <!--讨论区-->
        <div class="col-md-3">
            <div class="jichu chat">
                <div class="wenzi">
                    <a href="<%= basePath %>changePassword?1=1" style="text-decoration:none; color: aliceblue">
                        <h2>密码修改</h2>
                        <p>&nbsp;</p>
                    </a>
                </div>
                <div class="iconfont">
                    <span class="glyphicon glyphicon-comment"></span>
                </div>
                <a href="<%= basePath %>changePassword?1=1" class="moreduo"> 更多 <span
                        class="glyphicon glyphicon-circle-arrow-right"></span>
                </a>
            </div>
        </div>
    </div>
    </div>

    <!--第二行； 右侧刷新的内容块  -->
    <div class="container-fluid" style="margin-top: 20px;  margin-bottom: 50px;">
        <div class="row ">
            <!--第二行； 左侧内容块，占7列  -->
            <div class="col-md-7 gridly">

                <!-- 第二行左侧第一个box； 统计 -->
                <!--
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>本周系统使用统计</h4>
                        </div>
                        <div class="pull-right right-btn-group dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="#">历史记录</a></li>
                                </ul>
                            </div>
                            <a data-toggle="collapse">
                                <button>
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button>
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>

                    <div id="line" class="shrink"
                         style="min-width: 100px; height: 280px; border-top:solid 1px #eee; margin: 0 auto">
                    </div>
                </div>
                -->

                <!-- 第二行左侧第二个box； 待办任务  -->
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>我的待办任务</h4>
                        </div>
                        <div class="pull-right right-btn-group dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="<%=basePath%>workflow/myTask?1=1">更多</a></li>
                                    <!--<li><a href="flowmanage">流程管理</a></li>-->
                                </ul>
                            </div>
                            <a>
                                <button>
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button>
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>
                    <div id="" class="shrink">
                        <table class="table table-hover">
                            <tr>
                                <th> 流程名称</th>
                                <th> 节点名称</th>
                                <th> 待审核人</th>
                                <th> 申请人</th>
                                <th> 发起时间</th>
                                <th> 审核状态</th>
                                <th style="width:150px">操作</th>
                            </tr>
                            <tbody id="grid_bodyMyTask"></tbody>
                        </table>
                    </div>
                </div>

                <!-- 第二行左侧第三个box；公告通知  -->
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>公告通知</h4>
                        </div>
                        <div class="pull-right right-btn-group dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="<%=basePath%>t_news/toT_newsListGonggao?1=1">更多</a></li>
                                </ul>
                            </div>
                            <a>
                                <button>
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button>
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>

                    <div id="" class="shrink">
                        <table class="table table-hover">
                            <tr>
                                <th>标题</th>
                                <th>公告日期</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            <tbody id="grid_bodyGonggao"></tbody>
                        </table>
                    </div>
                </div>

                <!--第二行左侧第四个box； 我的会议 -->
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>预定的会议室</h4>
                        </div>
                        <div class="pull-right right-btn-group dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="<%=basePath%>t_news/toT_newsListMeeting?1=1">更多</a></li>
                                </ul>
                            </div>
                            <a>
                                <button>
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button>
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>
                    <div id="" class="shrink">
                        <table class="table table-hover">
                            <tr>
                                <th>会议主题</th>
                                <th>会议室</th>
                                <th>日期</th>
                                <th>开始时间</th>
                                <th>操作</th>
                            </tr>
                            <tbody id="grid_bodyMeeting"></tbody>
                        </table>
                    </div>
                </div>

                <!-- 第二行左侧第五个box；流程管理 -->
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>我的申请</h4>
                        </div>
                        <div class="pull-right right-btn-group dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="<%=basePath%>t_news/toT_newsListAll?1=1">发起申请</a></li>
                                    <li><a href="<%=basePath%>t_news/toT_newsAllApply?1=1">更多</a></li>
                                </ul>
                            </div>
                            <a>
                                <button>
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button>
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>
                    <div id="" class="shrink">
                        <table class="table table-hover">
                            <tr>
                                <th>编号</th>
                                <th>类型</th>
                                <th>申请人</th>
                                <th>申请时间</th>

                                <th>标题</th>
                                <th>审核状态</th>
                                <th style="width:150px">操作</th>
                            </tr>
                            <tbody id="grid_bodyMyLiucheng"></tbody>
                        </table>
                    </div>
                </div>

            </div>

            <!--第二行； 右侧内容块，占5列  -->
            <div class="rightcolmd">

                <!-- 第二行右侧第一个box行事历  -->
                <div class="panel" style="background-color: #00c86c;color: white;">
                    <div class="" style="border-bottom: 1px solid #94d294;;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4><span class="glyphicon glyphicon-calendar"></span>行事历</h4>
                        </div>
                        <div class="pull-right right-btn-group btn-color dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown" style="background: #18e89d !important;">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="<%=basePath%>t_news/toT_newsCurdRicheng?oplx=add">新增日程</a></li>
                                    <!--<li><a href="#">我的日历</a></li>-->
                                </ul>
                            </div>
                            <a>
                                <button style="background: #18e89d !important;">
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button style="background: #18e89d !important;">
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>
                    <div class="shrink" style="height: 280px;padding: 10px;">

                        <table cellpadding="2" style="border-collapse: collapse;width:100%;" class="calendar"
                               id="calendar">

                            <div>
                                <span class="glyphicon glyphicon-chevron-left month left"
                                      style="cursor:pointer;"></span>
                                <span class="glyphicon glyphicon-chevron-right month right"
                                      style="float:right;cursor:pointer;"></span>
                                <div class="yearmonth"
                                     style="text-align:center;width:70%;display:inline;margin-left: 154px;">
                                    <div>
                                    </div>
                                    <tbody>

                                    <tr style="color:white;  text-align: center !important;">
                                        <th style="text-align: center !important;">一</th>
                                        <th style="text-align: center !important;">二</th>
                                        <th style="text-align: center !important;">三</th>
                                        <th style="text-align: center !important;">四</th>
                                        <th style="text-align: center !important;">五</th>
                                        <th style="text-align: center !important;">六</th>
                                        <th style="text-align: center !important;">日</th>
                                    </tr>
                                    <tr>
                                        <td><span id="span"></span><span class="icon glyphicon glyphicon-flag"></span>
                                        </td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                    </tr>
                                    <tr>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                    </tr>
                                    <tr>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                    </tr>
                                    <tr>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                    </tr>
                                    <tr>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                    </tr>
                                    <tr>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                        <td><span id="span"></span><span class="icon"></span></td>
                                    </tr>
                                    </tbody>
                        </table>
                        <div id="blockdiv" style="
				background-color: white; display: none; z-index: 999; border: 1px solid rgb(105, 103, 103);
				position: absolute; color: rgb(105, 103, 103);text-align: center; ">
                        </div>
                    </div>

                </div>

                <!-- 第二行右侧第二个； 任务完成排行  -->
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>
                                我的日程
                            </h4>
                        </div>
                        <div class="pull-right right-btn-group btn-color dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="<%=basePath%>t_news/toT_newsCurdRicheng?oplx=add">新增日程</a></li>
                                </ul>
                            </div>
                            <a href="#column" data-toggle="collapse">
                                <button>
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button>
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>

                    <div id="column" class="shrink"
                         style="min-width: 100px; height:auto ; margin: 0 auto;border-top:solid 1px #eee; ">

                        <table class="table table-hover">
                            <tr>

                                <th style="align: center; width: 30%;">&nbsp;&nbsp;主题</th>
                                <th style="align: center; width: 20%;">&nbsp;&nbsp;时间</th>
                                <th style="align: center; width: 30%;">&nbsp;&nbsp;内容</th>

                                <th style="width:20%; ">&nbsp;&nbsp;操作</th>
                            </tr>
                            <tbody id="grid_bodyMyRicheng"></tbody>
                        </table>
                    </div>

                </div>

                <!--第二行左侧第三个box； 我的便签
                <div class="panel panel-default box-show green-box">
                    <div class="panel-heading box-show-heading"
                         style="background: white;">
                        <div class="panel-title" style="display: inline-block;">
                            <h4>
                                <span class="glyphicon glyphicon-pushpin"> </span> 我的便签
                            </h4>
                        </div>
                        <div class="pull-right right-btn-group btn-color dropdown"
                             style="display: inline-block;">
                            <div style="display: inline-block;">
                                <button data-toggle="dropdown" style="background: #18e89d !important;">
                                    <span class="glyphicon glyphicon-menu-hamburger"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="userpanel">我的便签</a></li>
                                </ul>
                            </div>
                            <a>
                                <button style="background: #18e89d !important;">
                                    <span class="glyphicon glyphicon-minus shousuo"></span>
                                </button>
                            </a>
                            <button style="background: #18e89d !important;">
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </div>
                    </div>

                    <div class="shrink">
                        <ul class="list-group">

                            <li class="list-group-item list-group-item-li" style=""><img
                                    src="/images/timg.jpg" alt="photo" title="wowoowo"
                                    class="item-li-img"/>
                                <p class="item-li-p">
                                    <a href="userpanel">测试<small class="pull-right"
                                                                 style="color: #777;"><span
                                            class="glyphicon glyphicon-time"></span>2019-1-5</small>
                                    </a><br> 测试
                                </p></li>

                        </ul>
                        <div class="input-group input-div">
                            <input type="text" placeholder="便签内容" style="outline: none;" class="concent"/> <a
                                id="writep" style="cursor: pointer;"><span class="glyphicon glyphicon-plus"
                                                                           style="margin-top: 6px;"></span></a>
                        </div>
                    </div>

                </div>
                -->

            </div>
        </div>
    </div>

    <script>
        //基础图标放大缩小
        $('.jichu').on('mouseover', function () {
            $(this).children('.iconfont').children('.glyphicon').css('font-size', '88px');
        });

        $('.jichu').on('mouseout', function () {
            $(this).children('.iconfont').children('.glyphicon').css('font-size', '76px');
        });
        /* 关闭面板按钮 */
        $('.glyphicon-remove').parent().on('click', function () {
            if (confirm("确定关闭此面板吗？") == false) {
                return false;
            }
            console.log($(this).parents('.box-show'));
            $(this).parents('.box-show').css('display', 'none');

        });

        $(".shousuo").on('click', function () {
            if ($(this).hasClass("glyphicon-plus")) {
                console.log("0000")
                $(this).removeClass("glyphicon-plus").addClass("glyphicon-minus")
                $(this).parents(".panel").children(".shrink").slideToggle(100);
            } else {
                console.log("1111")
                $(this).removeClass("glyphicon-minus").addClass("glyphicon-plus")
                $(this).parents(".panel").children(".shrink").slideToggle(100);
            }
        })

        $("#writep").click(function () {
            var $concent = $(".concent").val();
            if ($concent == null || $concent == "")
                return confirm("您输入为空 请重新输入");
            $.ajax({
                url: 'writep',
                data: {concent: $concent},
                type: "get",
                success: function () {
                    window.location.reload();
                }
            })
        })
        $(".icon").css({
            "right": "0px",
            "top": "-10px",
            "height": "5px"
        })

        /*  $(".col-md-7 ").children("div").addClass("drag-item");
        $(".rightcolmd ").children("div").addClass("drag-item"); */
        /* $("#calendar td").css({
            "text-align":"center"
        }) */
        /* $(".drag-item").draggable({
            revert:true,
        }).droppable({
            onDragOver:function(e,source){
            },
            onDrop:function(e,source){
                $(source).insertAfter(this);
                $(source).insertBefore(this);
            }
        });   */
    </script>

    <!--
    <script src="<%=basePath%>js/littlecalendar.js"></script>
-->
    <script src="<%=basePath%>js/highcharts/jquery.js"></script>
    <script src="<%=basePath%>js/highcharts/highcharts.js"></script>
    <!--<script src="js/tongji.js"></script>-->
    <script src="<%=basePath%>js/my-jquery-curd.js"></script>
    <script type="text/javascript">

        $().ready(function () {
            //1、初始化数据显示
            SearchMyTask(0);
            SearchMyLiucheng(0);
            SearchGonggao(0);
            SearchMeeting(0);
            SearchRicheng(0);
        }) //end funciton read;

        //根据查询条件，查询列表数据并显示
        function SearchRicheng(startIndex) {
            var url = "<%=basePath%>t_news/getAllT_news?startIndex=0&pageSize=1000&creater=<%=request.getSession().getAttribute("username")%>&biztype=RiCheng&time=" + Math.random();
            //alert(url);
            $.getJSON(url, function (data) {
                $("#grid_bodyMyRicheng").html("");
                //1、表格行内容输出
                $.each(data.items, function (i, item) {
                    var str = "<tr>";
                    str += "<td>" + doNull(item.title) + "</td>";
                    str += "<td>" + doNull(item.ext1) + "</td>";
                    str += "<td>" + doNull(item.memo) + "</td>";
                    str += "<td>&nbsp;&nbsp;";
                    str += "<a href='<%=basePath%>t_news/toT_newsCurdRicheng?oplx=view&id=" + item.id + "' class='text-danger'>&nbsp;&nbsp;<span  class='label label-success'><span class='glyphicon glyphicon-search'>查看</span></span>&nbsp;&nbsp;</a>";
                    str += "</td>";
                    str += "</tr>";
                    $("#grid_bodyMyRicheng").append(str);
                });//end each data;
            })//end getJSON;
        }

        //根据查询条件，查询列表数据并显示
        function SearchMyTask(startIndex) {
            var url = "<%=basePath%>workflow/getTaskNodeInstanceList?startIndex=0&tninstancestatus=0&pageSize=3&showtninstancestatus=待审核&time=" + Math.random();
            //alert(url);
            $.getJSON(url, function (data) {
                $("#grid_bodyMyTask").html("");
                //1、表格行内容输出
                $.each(data.items, function (i, item) {
                    var str = "<tr>";
                    str += "<td>" + doNull(item.firststep) + "</td>";
                    str += "<td>" + doNull(item.laststep) + "</td>";
                    str += "<td>" + doNull(item.userid) + "</td>";
                    //str += "<td>" + doNull(item.creater) + "</td>";
                    //str += "<td>" + doNull(item.createtime) + "</td>";
                    str += "<td>" + doNull(item.memo1) + "</td>";
                    str += "<td>" + doNull(item.memo2) + "</td>";
                    //str+="<td>"+doNull(item.tninstancestatus)+"</td>";
                    if (item.tninstancestatus == 0) {
                        str += "<td><span class='label label-info'>待审核</span></td>";
                    } else if (item.tninstancestatus == 1) {
                        str += "<td><span class='label label-success'>已结束</span></td>";
                    } else if (item.tninstancestatus == 2) {
                        str += "<td><span class='label label-danger'>已退回</span></td>";
                    } else {
                        str += "<td><span class='label label-danger'>其它</span></td>";
                    }
                    str += "<td>";
                    //去不同的审核页面
                    var toUrl = "";
                    if (doNull(item.biztype) == "ContractApply") {
                        toUrl = "t_news/toT_newsContractSH";
                    } else if (doNull(item.biztype) == "MoneyApply") {
                        toUrl = "t_news/toT_newsMoneySH";
                    } else if (doNull(item.biztype) == "PayApply") {
                        toUrl = "t_news/toT_newsPaySH";
                    } else if (doNull(item.biztype) == "YongyinApply") {
                        toUrl = "t_news/toT_newsYongyinSH";
                    } else if (doNull(item.biztype) == "FawenApply") {
                        toUrl = "t_news/toT_newsFawenSH";
                    } else if (doNull(item.biztype) == "ReceiveApply") {
                        toUrl = "t_news/toT_newsReceiveSH";
                    } else if (doNull(item.biztype) == "GetApply") {
                        toUrl = "t_news/toT_newsGetSH";
                    } else if (doNull(item.biztype) == "CarApply") {
                        toUrl = "t_news/toT_newsCarSH";
                    } else if (doNull(item.biztype) == "HolidyApply") {
                        toUrl = "t_news/toT_newsHolidySH";
                    } else if (doNull(item.biztype) == "OutApply") {
                        toUrl = "t_news/toT_newsOutSH";
                    } else if (doNull(item.biztype) == "TrivalApply") {
                        toUrl = "t_news/toT_newsTrivalSH";
                    } else if (doNull(item.biztype) == "AddjobApply") {
                        toUrl = "t_news/toT_newsAddjobSH";
                    } else if (doNull(item.biztype) == "AddcardApply") {
                        toUrl = "t_news/toT_newsAddcardSH";
                    } else if (doNull(item.biztype) == "KuaidiApply") {
                        toUrl = "t_news/toT_newsCurdKuaidiSH";
                    } else if (doNull(item.biztype) == "MyApply") {
                        toUrl = "t_company/toT_companyCurdSH";
                    } else {
                        toUrl = "t_demo/toT_demoCurdSH";
                    }
                    str += "<a href='<%=basePath%>" + toUrl + "?oplx=check&appid=" + item.appid + "&tninstanceid=" + item.tninstanceid + "&instanceid=" + item.instanceid + "&biztype=" + item.biztype + "&taskid=" + item.taskid + "' class='text-danger'>&nbsp;&nbsp;<span  class='label label-success'><span class='glyphicon glyphicon-search'>审核</span></span>&nbsp;&nbsp;</a>";
                    //str += "<a href='<%=basePath%>workflow/toShFactory?oplx=check&appid=" + item.appid + "&tninstanceid=" + item.tninstanceid + "&instanceid=" + item.instanceid + "&biztype=" + item.biztype + "&taskid=" + item.taskid + "'  title=''> <span  class='label label-success'><span class='glyphicon glyphicon-search'> </span>审核</span></a>&nbsp;&nbsp;";
                    //}
                    str += "</td>";
                    str += "</tr>";
                    $("#grid_bodyMyTask").append(str);
                    //alert(str);
                });//end each data;
            })//end getJSON;
        }

        //根据查询条件，查询列表数据并显示
        function SearchMyLiucheng(startIndex) {
            var biztype = "MyApply";
            var creater = "<%=request.getSession().getAttribute("username")%>";//"<%=request.getSession().getAttribute("userid")%>";
            var url = "<%=basePath%>t_news/getAllT_news?startIndex=0&pageSize=5&creater=" + creater + "&biztype=" + biztype + "&time=" + Math.random();
            //alert(url);
            $.getJSON(url, function (data) {
                $("#grid_bodyMyLiucheng").html("");
                //1、表格行内容输出
                $.each(data.items, function (i, item) {
                    var str = "<tr>";
                    str += "<td>" + doNull(item.id) + "</td>";
                    str += "<td>" + doNull(item.level1name) + "</td>";
                    str += "<td>" + doNull(item.creater) + "</td>";
                    str += "<td>" + doNull(item.creattime) + "</td>";

                    str += "<td>" + doNull(item.title) + "</td>";
                    if (doNull(item.process_status) == "0") {
                        str += "<td><span class='label label-info'>审核中 </span></td>";
                    } else if (doNull(item.process_status) == "2") {
                        str += "<td><span class='label label-danger'>已退回 </span></td>";
                    } else if (doNull(item.process_status) == "1") {
                        str += "<td><span class='label label-success'>审核通过 </span></td>";
                    } else {
                        str += "<td><span class='label label-warning'>草稿 </span></td>";
                    }

                    str += "<td>&nbsp;&nbsp;";
                    var toUrl = "";
                    if (doNull(item.types) == "ContractApply") {
                        toUrl = "toT_newsContract";
                    } else if (doNull(item.types) == "MoneyApply") {
                        toUrl = "toT_newsMoney";
                    } else if (doNull(item.types) == "PayApply") {
                        toUrl = "toT_newsPay";
                    } else if (doNull(item.types) == "YongyinApply") {
                        toUrl = "toT_newsYongyin";
                    } else if (doNull(item.types) == "FawenApply") {
                        toUrl = "toT_newsFawen";
                    } else if (doNull(item.types) == "ReceiveApply") {
                        toUrl = "toT_newsReceive";
                    } else if (doNull(item.types) == "GetApply") {
                        toUrl = "toT_newsGet";
                    } else if (doNull(item.types) == "CarApply") {
                        toUrl = "toT_newsCar";
                    } else if (doNull(item.types) == "HolidyApply") {
                        toUrl = "toT_newsHolidy";
                    } else if (doNull(item.types) == "OutApply") {
                        toUrl = "toT_newsOut";
                    } else if (doNull(item.types) == "TrivalApply") {
                        toUrl = "toT_newsTrival";
                    } else if (doNull(item.types) == "AddjobApply") {
                        toUrl = "toT_newsAddjob";
                    } else if (doNull(item.types) == "AddcardApply") {
                        toUrl = "toT_newsAddcard";
                    } else if (doNull(item.types) == "KuaidiApply") {
                        toUrl = "toT_newsCurdKuaidi";
                    }

                    str += "<a href='<%=basePath%>t_news/" + toUrl + "?oplx=view&id=" + item.id + "' class='text-danger'>&nbsp;&nbsp;<span  class='label label-success'><span class='glyphicon glyphicon-search'>查看</span></span>&nbsp;&nbsp;</a>";
                    str += "</td>";
                    str += "</tr>";
                    $("#grid_bodyMyLiucheng").append(str);
                });//end each data;
            })//end getJSON;
        }

        //根据查询条件，查询列表数据并显示
        function SearchGonggao(startIndex) {
            var url = "<%=basePath%>t_news/getAllT_news?startIndex=0&status=1&pageSize=5&biztype=OaGongGao&time=" + Math.random();
            //alert(url);
            $.getJSON(url, function (data) {
                $("#grid_bodyGonggao").html("");
                //1、表格行内容输出
                $.each(data.items, function (i, item) {
                    var str = "<tr>";
                    str += "<td>" + doNull(item.title) + "</td>";
                    str += "<td>" + doNull(item.newdate) + "</td>";
                    if (doNull(item.status) == "0") {
                        str += "<td><span class='label label-primary'>草稿 </span></td>";
                    } else if (doNull(item.status) == "2") {
                        str += "<td><span class='label label-danger'>无效 </span></td>";
                    } else if (doNull(item.status) == "1") {
                        str += "<td><span class='label label-success'>有效 </span></td>";
                    } else {
                        str += "<td><span class='label label-danger'>未知状态 </span></td>";
                    }

                    str += "<td>&nbsp;&nbsp;";
                    str += "<a href='<%=basePath%>t_news/toT_newsCurdGonggao?oplx=view&id=" + item.id + "' class='text-danger'>&nbsp;&nbsp;<span  class='label label-success'><span class='glyphicon glyphicon-search'>查看</span></span>&nbsp;&nbsp;</a>";
                    str += "</td>";
                    str += "</tr>";
                    $("#grid_bodyGonggao").append(str);
                });//end each data;
            })//end getJSON;
        }

        //根据查询条件，查询列表数据并显示
        function SearchMeeting(startIndex) {
            var url = '<%=basePath%>t_news/getAllT_news?creater=<%=request.getSession().getAttribute("userid")%>&startIndex=0&pageSize=5&biztype=Meeting&time=' + Math.random();
            //alert(url);
            $.getJSON(url, function (data) {
                //$("#pageSize").html(data.pageSize);
                $("#totalCount").html(data.totalCount);
                $("#totalPageNo").html(data.totalPageNo);
                $("#grid_body").html("");

                //1、表格行内容输出
                $.each(data.items, function (i, item) {
                    var str = "<tr>";
                    var starttime = doNull(item.ext2);
                    if(null!=starttime&&""!=starttime){
                        if(starttime.length>11){
                            starttime =starttime.substring(0,4) +"...";
                        }
                    }
                    str += "<td>" + doNull(item.title) + "</td>";
                    str += "<td>" + doNull(item.newfrom) + "</td>";
                    str += "<td>" + doNull(item.ext1) +"</td>";
                    str += "<td>" + starttime +"</td>";
                    str += "<td>&nbsp;&nbsp;";
                    str += "<a href='<%=basePath%>t_news/toT_newsCurdMeeting?oplx=view&id=" + item.id + "' class='text-danger'>&nbsp;&nbsp;<span  class='label label-success'><span class='glyphicon glyphicon-search'>查看</span></span>&nbsp;&nbsp;</a>";
                    str += "</td>";
                    str += "</tr>";
                    $("#grid_bodyMeeting").append(str);
                });//end each data;
            })//end getJSON;
        }
    </script>
    <script>
        var yearmonth, days, date, year, month;

        $(function () {

            //改一下这个表格事件
            //去掉

            //设置表格头部的年月
            date = new Date();
            year = date.getFullYear();
            month = date.getMonth() + 1;
            var year2 = year;
            var month2 = month;
            yearmonth = year + "年" + month + "月";
            ;


            function getdaysofmonth(yy, mm) {
                //根据人年和平年 以及135781012等判断月的天数
                if (mm == 14 && yy % 4 == 0 && yy % 100 != 0) {
                    days = 28;
                } else if (mm == 1 || mm == 3 || mm == 5 || mm == 7 || mm == 8 || mm == 10 || mm == 12 || mm == 13) {
                    days = 31;
                } else if (mm == 4 || mm == 6 || mm == 9 || mm == 11) {
                    days = 30;
                } else {
                    days = 29;
                }
                return days;
            }

            function initcalendar(yy, mm) {


                $(".yearmonth").text(yy + "年" + mm + "月");
                var nowdays = getdaysofmonth(yy, mm);
                //注意在这个公式里面1.2月份要当去年的13.14月计算
                if (mm == 1) mm = 13;
                if (mm == 2) mm = 14;
                if (mm > 12) yy--;
                var c = parseInt(yy / 100);
                var y = yy % 100;
                /*蔡勒公式迅速获得该月的1号是星期几*/
                var week = y + parseInt(y / 4) + parseInt(c / 4) - 2 * c + parseInt(26 * (mm + 1) / 10) + 1 - 1;
                //week为负数和正数求摸不一样
                week = week < 0 ? ((week % 7) + 7) % 7 : week % 7;

                //接下来计算该月有多少天
                //获取表格里面的数据
                //由于中国日历和西方不同中国week等于7表示星期日西方周日是0
                if (week == 0)
                    week = 7;
                //在生成之前清空所有的数据不然会出事
                for (var i = 0; i < 42; i++) {
                    $(".calendar td #span").eq(i).text('');
                    $(".calendar td .icon").eq(i).removeClass("glyphicon glyphicon-flag");
                }


                //得到上个月数字
                for (var i = 0; i < week - 1; i++) {
                    var lastmonth, lastyear;
                    if (mm == 1) {
                        lastmonth = 12;
                        lastyear = yy - 1;
                    } else {
                        lastmonth = mm - 1;
                        lastyear = yy;
                    }
                    var lastdays = getdaysofmonth(lastyear, lastmonth);
                    //alert(lastyear+";"+lastmonth+";"+lastdays)
                    $(".calendar td #span").eq(i).text(lastdays - (week - 1) + i + 1).addClass("lastMonth");
                }

                //星期一是0星期二是1一次类推星期日是6就是week-1
                for (var i = 0; i < nowdays; i++) {
                    //给当月日期加颜色
                    $(".calendar td #span").eq(i + (week - 1)).text(i + 1).addClass("currentday").removeClass("lastMonth").removeClass("nextMonth");
                    //给当天日期加颜色
                    if (yy == year && mm == month) {
                        $(".calendar td #span").eq(date.getDate() + (week - 1) - 1).removeClass("currentday").addClass("today")
                    }

                }
                //得到下个月数字
                for (var i = nowdays + week - 1; i < 42; i++) {
                    $(".calendar td #span").eq(i).text(i + 1 - (nowdays + week - 1)).addClass("nextMonth").removeClass("currentday");
                }

                var creater = "<%=request.getSession().getAttribute("username")%>";
                //行事历 数据加载
                var urlGetRicheng = "<%=basePath%>t_news/getAllT_news?startIndex=0&creater="+creater+"&pageSize=1000&biztype=RiCheng&time=" + Math.random();
                $.ajaxSettings.async = false;
                $.getJSON(urlGetRicheng, function (data){
                    var temp="";
                    var temp2="";
                    $.each(data.items, function(i,item){
                        temp += item.ext1+",";
                        temp2 += item.id+",";
                        //alert("temp["+i+"]="+temp);
                    });//end each data;
                    //alert("temp="+temp);

                    var a = temp;
                    //a = JSON.stringify(data).substring(1, JSON.stringify(data).length - 1);
                    //a = a.replace(/\"/g, "");

                    a = a.split(",");
                    var richengids = temp2.split(",");
                    //alert("====="+a);
                    $("#calendar td").each(function (e) {
                        //每个表格里面的值
                        var date2;
                        //在这里获取日期
                        var last, next;
                        var month = $(".yearmonth").text().substring(5, $(".yearmonth").text().length - 1);
                        month = parseInt(month);
                        if (month == 1) {
                            last = 12;
                            next = month + 1;
                        }
                        if (month == 12) {
                            last = month - 1;
                            next = 1;
                        } else {
                            last = month - 1;
                            next = month + 1;
                        }

                        var $riqi = $(this).children("#span");
                        var $tomonth = $(".yearmonth").text().substring(5, $(".yearmonth").text().length - 1)
                        var $toyear = $(".yearmonth").text().substring(0, 4)
                        if ($tomonth < 10)
                            var $tomonth = "0" + $tomonth
                        else
                            var $tomonth = $tomonth
                        if ($riqi.text() < 10)
                            var $day = "0" + $riqi.text()
                        else
                            var $day = $riqi.text()
                        if ($riqi.hasClass("nextMonth"))
                            date2 = $toyear + "-" + next + "-" + $day;
                        if ($riqi.hasClass("currentday"))
                            date2 = $toyear + "-" + $tomonth + "-" + $day;
                        if ($riqi.hasClass("today"))
                            date2 = $toyear + "-" + $tomonth + "-" + date.getDate();
                        if ($riqi.hasClass("lastMonth"))
                            date2 = $toyear + "-" + last + "-" + $day;

                        //小红旗显示日程， @davexin
                        for (var i = 0; i < a.length; i++) {
                            if (date2 == a[i]) {
                                //console.log(date2)
                                //$(this).children(".icon").addClass("glyphicon glyphicon-flag");
                                var strday=$(this).children("#span").text();
                                //$(this).children("#span").html("<a href='<%=basePath%>t_news/toT_newsCurdRicheng?id="+richengids[i]+"&oplx=view'>"+strday+"</a>");
                                var url="<%=basePath%>t_news/toT_newsCurdRicheng?id="+richengids[i]+"&oplx=view";
                                $(this).html('<a href="'+url+'" style="display:block;"><span id="span" class="currentday">'+strday+'</span><span class="icon glyphicon glyphicon-flag" style="right: 0px; top: -10px; height: 5px;"></span></a>');

                            }
                        }
                       //alert(date2);
                    })
                })//end getJSON;

/*
                $.ajax({
                    dataType: "json",
                    url: urlGetRicheng,
                    traditional: true,
                    error: function () {
                    }
                    , success: function (data) {

                        var a = JSON.stringify(data).substring(1, JSON.stringify(data).length - 1);
                        a = a.replace(/\"/g, "");
                        a = a.split(",");

                        $("#calendar td").each(function (e) {
                            //每个表格里面的值
                            var date2;
                            //在这里获取日期
                            var last, next;
                            var month = $(".yearmonth").text().substring(5, $(".yearmonth").text().length - 1);
                            month = parseInt(month);
                            if (month == 1) {
                                last = 12;
                                next = month + 1;
                            }
                            if (month == 12) {
                                last = month - 1;
                                next = 1;
                            } else {
                                last = month - 1;
                                next = month + 1;
                            }

                            var $riqi = $(this).children("#span");
                            var $tomonth = $(".yearmonth").text().substring(5, $(".yearmonth").text().length - 1)
                            var $toyear = $(".yearmonth").text().substring(0, 4)
                            if ($riqi.text() < 10)
                                var $day = "0" + $riqi.text()
                            else
                                var $day = $riqi.text()
                            if ($riqi.hasClass("nextMonth"))
                                date2 = $toyear + "-" + next + "-" + $day;
                            if ($riqi.hasClass("currentday"))
                                date2 = $toyear + "-" + $tomonth + "-" + $day;
                            if ($riqi.hasClass("today"))
                                date2 = $toyear + "-" + $tomonth + "-" + date.getDate();
                            if ($riqi.hasClass("lastMonth"))
                                date2 = $toyear + "-" + last + "-" + $day;
                            for (var i = 0; i < a.length; i++) {
                                if (date2 == a[i]) {
                                    console.log(date2)
                                    $(this).children(".icon").addClass("glyphicon glyphicon-flag");
                                }
                            }
                        })

                    }
                })
                */


            }


            initcalendar(year, month)

            $(".month").on('click', function () {

                if ($(this).hasClass("left")) {
                    //上一个月减
                    if (month2 == 1) {
                        month2 = 12;
                        year2--;
                    } else {
                        month2--;
                    }
                } else {

                    //下一个月加
                    if (month2 == 12) {
                        month2 = 1;
                        year2++;
                    } else {
                        month2++;
                    }
                }
                initcalendar(year2, month2)

            })


            $("#calendar td").each(function (e) {
                $(this).on("mouseover mouseout", function (event) {
                    if (event.type == "mouseover") {
                        $(this).css({
                            "background-color": "#005E33",
                        })
                        //显示数字
                        var last, next;
                        var month = $(".yearmonth").text().substring(5, $(".yearmonth").text().length - 1);
                        month = parseInt(month);
                        if (month == 1) {
                            last = 12;
                            next = month + 1;
                        }
                        if (month == 12) {
                            last = month - 1;
                            next = 1;
                        } else {
                            last = month - 1;
                            next = month + 1;
                        }

                        var $riqi = $(this).children("#span");
                        var $tomonth = $(".yearmonth").text().substring(5, $(".yearmonth").text().length - 1)
                        if ($riqi.hasClass("nextMonth"))
                            $("#blockdiv").text(next + "月" + $riqi.text() + "日")
                        if ($riqi.hasClass("currentday"))
                            $("#blockdiv").text($tomonth + "月" + $riqi.text() + "日")
                        if ($riqi.hasClass("today"))
                            $("#blockdiv").text($tomonth + "月" + date.getDate() + "日")
                        if ($riqi.hasClass("lastMonth")) {
                            $("#blockdiv").text(last + "月" + $riqi.text() + "日")
                        }

                        $("#blockdiv").css({
                            "display": "block",
                            "left": event.pageX + 5,
                            "top": event.pageY + 20,
                        })
                    }
                    if (event.type == "mouseout") {
                        $(this).css({
                            "background-color": "",
                            "border": "",
                        })
                        $("#blockdiv").css({
                            "display": "none",
                        })
                    }
                })
            });


        })
    </script>
